/*  _stddef.h

    multi-includable Definitions for common types, and NULL

*/

/*
 *      C/C++ Run Time Library - Version 1.0
 *
 *      Copyright (c) 1987, 2002 by Borland Software Corporation
 *      All Rights Reserved.
 *
 */

/* $Revision: 1.5.8.2 $ */

#ifndef ___STDDEF_H
#define ___STDDEF_H

#if !defined(___DEFS_H)
#include <_defs.h>
#endif

#ifndef NULL
#include <_null.h>
#endif

#ifdef __cplusplus
namespace std {
#endif /* __cplusplus */

/* Define __STD to expand to std:: or nothing depending on being in C++. */
#ifdef __cplusplus
#  define __STD std ::
#else
#  define __STD
#endif

/*
   Define the size_t type in the std namespace if in C++ or globally if in C.
   If we're in C++, make the _SIZE_T macro expand to std::size_t
*/

#if !defined(_SIZE_T) && !defined(_SIZE_T_DEFINED)
#  define _SIZE_T_DEFINED
   typedef unsigned int size_t;
#  if defined(__cplusplus)
#    define _SIZE_T std ::size_t
#  else
#    define _SIZE_T size_t
#  endif
#endif


#if !defined(_WINT_T) && !defined(_WINT_T_DEFINED)
#  define _WINT_T_DEFINED
   typedef unsigned int wint_t;
#  if defined(__cplusplus)
#    define _WINT_T std ::wint_t
#  else
#    define _WINT_T wint_t
#  endif
#endif


#ifndef _PTRDIFF_T
#define _PTRDIFF_T
typedef int     ptrdiff_t;
#endif


#define offsetof( s_name, m_name )  (unsigned int)&(((s_name _FAR *)0)->m_name)

#ifndef __cplusplus
#if !defined(_WCHAR_T)
#define _WCHAR_T
# ifdef __linux__
typedef unsigned wchar_t;
# else
typedef unsigned short wchar_t;
# endif
#endif
#endif

#ifdef __cplusplus
} // std
#endif /* __cplusplus */

#endif  /* __STDDEF_H */

#if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(___STDDEF_H_USING_LIST)
#define ___STDDEF_H_USING_LIST
     using std ::ptrdiff_t;
     using std ::wint_t;
     using std ::size_t;
#endif /* __USING_CNAME__ */
